import React from 'react'
import { ProductCard, Tag, Button } from 'react-vant';
import ViewProductCard from './ViewProductCard';
export default React.memo (function Card({ item }: any) {
  return (
    <div>
      <div style={{ marginTop: '2rem' }}>
        <div style={{ height: '3rem', background: '#fafafa', paddingLeft: '1.3rem', boxSizing: 'content-box', position: 'relative' }}>
          <span>订单号：{item._id}</span>
          <span style={{ position: 'absolute', right: '1.3rem' }}>
            {
              item.data === 1 ?
                <div style={{ color: 'red' }}>待兑换</div> :
                item.data === 2 ?
                  <div style={{ color: 'red' }}>待收货</div> :
                  item.data === 3 ?
                    <div style={{ color: '#b3b3b3' }}>已取消</div> :
                    <div style={{ color: '#b3b3b3' }}>已完成</div>
            }
          </span>
        </div>
        <hr style={{ border: 'none', borderTop: '1px solid rgb(218 216 216)', width: '96%', margin: 'auto' }} />
        <ProductCard
          key={item._id}
          price={item.integral}
          title={item.title}
          thumb={item.image}
          lazyload={true}
          style={{ marginTop: '0' }}
          footer={
            <>
              <ViewProductCard item={item} />
            </>
          }
        />
      </div>
    </div>
  )
})
